package com.ivo.activiti.hr.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 部门
 * @author wj
 * @version 1.0
 */
@Data
@Entity
@Table(name = "HR_O_Department")
@JsonIgnoreProperties(value = {"deptHead"})
public class Department implements Serializable {

    /**
     * 部门编号
     */
    @Id
    @Column(name = "Department_ID")
    private String department_ID;

    /**
     * 名称
     */
    @Column(name = "DeptName")
    private String departmentName;

    /**
     * 主管
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "DeptHead_FK")
    private Employee deptHead;

    /**
     * 上级部门
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Parent_FK")
    private Department parentDept;

    /**
     * 英文名称
     */
    @Column(name = "DeptName_EN")
    private String deptName_EN;

    /**
     * 简称
     */
    @Column(name = "DeptName_S")
    private String deptName_S;

    /**
     * 部门等级
     */
    @Column(name = "DeptLevel_FK")
    private double deptLevel;

    /**
     * 部门路径
     */
    @Column(name = "DeptPath")
    private String deptPath;

    /**
     * 成本中心
     */
    @Column(name = "CostCenter_FK")
    private String costCenter;

    /**
     * 逻辑删除标识
     */
    @Column(name = "validFlag")
    private boolean validFlag = true;
}
